export default {
  description: 'generate store',
  prompts: [
    {
      type: 'input',
      name: 'name',
      message: 'store name',
      validate: (name) => {
        if (!name)
          return 'store name is required'
        return true
      },
    },
  ],
  actions: [
    {
      type: 'add',
      path: 'src/stores/modules/{{ name }}.ts',
      templateFile: 'plop-templates/store/module.ts.hbs',
    },
    {
      type: 'modify',
      path: 'src/stores/index.ts',
      pattern: /(\/\/ -- append module here --)/gi,
      templateFile: 'plop-templates/store/index.ts.hbs',
    },
  ],
}
